<#compress>
<!DOCTYPE>
<html>
<head>
    <#include "plat/include.ftl"/>
    <script type="text/javascript" src="${base}/js/plugins/buttons/spin.min.js"></script>
    <script type="text/javascript" src="${base}/js/plugins/buttons/ladda.min.js"></script>
</head>
<body style="background: white">
<div class="panel-body">
    <form id="commentForm">
        <input name="code" id="code" type="hidden" value="${command.code}"/>
        <table class="table table-striped table-bordered" style="max-width: 600px;">
            <tr>
                <th>系统名称*：</th>
                <td>
                    <input  type="text" id="name" value="${command.name}" name="name" class="form-control"/>
                </td>
            </tr>
            <tr>
                <th>启用状态：</th>
                <td>
                    <select id="flag" name="flag" class="form-control">
                        <option value="1" ${(command.flag=='1')?string('selected="selected"','')}>启用</option>
                        <option value="0" ${(command.flag=='0')?string('selected="selected"','')}>禁用</option>
                    </select>
                </td>
            </tr>
        </table>
    </form>
    <div style="text-align: center;margin-top: 10px">
        <button style="width: 120px" class="btn btn-primary btn-ladda btn-ladda-spinner" data-style="expand-right" data-spinner-color="#333" data-spinner-size="20" type="button" onclick="save()">提交</button>
    </div>
</div>
<script>
    function save() {
        var name;
        var flag=$('#flag').val();
        var code=$('#code').val();
        if((name=checkNull($("#name")))===false) {
            return;
        }
        var l = Ladda.create( document.querySelector( '.btn-ladda-spinner' ) );
        l.start();
        post('pl/platform/saveContextInfo',{name:name,code:code,flag:flag},function (result) {
            if(result.code==0){
                parent.table.ajax.reload();
                dialogClose();
            }else{
                alertError(result.message);
            }
            l.stop();
        });

    }
</script>
</body>
</html>
</#compress>